<%@page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>
    <title>项目分布</title>
	<%@ include file="/common/header/meta.jsp"%>
	<%@ include file="/common/header/script.jsp"%>
	<link rel="stylesheet" href="<%=basePath%>/css/report.css" />
    <script type="text/javascript">
    var options = {
   		chart: {
	           plotBackgroundColor: null,
	           plotBorderWidth: null,
	           plotShadow: false,
           },
           title: {
               style: { color: '#000', font: 'bold 16px "Trebuchet MS", Verdana, sans-serif' }
           },
           exporting : {
   			filename : '华智项目状态统计'
   		},
   		colors: ["#55BF3B", "#058DC7", "#8BBC21", "#ED561B", "#910000"], 
           tooltip: {
           	headerFormat: '<span style="font-size:12px"><b>{point.key}</b></span><br>',
       	    pointFormat: '<font style="font-size:12px;"><b>{series.name}</b></font>: <b>{point.percentage:.1f}%</b>'
           },
           plotOptions: {
               pie: {
                   allowPointSelect: true,
                   cursor: 'pointer',
                   dataLabels: {
                       enabled: true,
                       useHTML: true,
                       color: '#000000',
                       connectorColor: '#000000',
                       format: '<font style="font-size:12px;"><b>{point.name}</b></font>: {point.percentage:.1f} %',
                       distance: 22
                   },
                   size:180
               },
           },
           series: [{
               type: 'pie',
               name: '率',
               data: []
           }]
   	};
	$(function() {
		$.post($.webapp.root+"/admin/oa/project/get_project_id_type_count_report.do", function(result) {
			$(".report_text div#TA").css("color","#55BF3B").children("span:eq(1)").html(result[0][1]) ;
			$(".report_text div#HTXM").css("color","#058DC7").children("span:eq(1)").html(result[1][1]) ;
			$(".report_text div#ZZYF").css("color","#8BBC21").children("span:eq(1)").html(result[2][1]) ;
			$(".report_text div#GSSY").css("color","#ED561B").children("span:eq(1)").html(result[3][1]) ;
			$(".report_text div#GSTZ").css("color","#ED561B").children("span:eq(1)").html(result[4][1]) ;
			options.series[0].data = result ;
			options.title.text = 'ID类型区分统计' ;
			options.chart.renderTo = container1 ;
			chart = new Highcharts.Chart(options);
			
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
		
		$.post($.webapp.root+"/admin/oa/project/get_project_status_count_report.do", function(result) {
			$(".report_text div#status0").css("color","#55BF3B").children("span:eq(1)").html(result[0][1]) ;
			$(".report_text div#status1").css("color","#058DC7").children("span:eq(1)").html(result[1][1]) ;
			$(".report_text div#status2").css("color","#8BBC21").children("span:eq(1)").html(result[2][1]) ;
			$(".report_text div#status3").css("color","#ED561B").children("span:eq(1)").html(result[3][1]) ;
			$(".report_text div#status4").css("color","#910000").children("span:eq(1)").html(result[4][1]) ;
			options.series[0].data = result ;
			options.title.text = '项目状态统计' ;
			options.chart.renderTo = container2 ;
			chart = new Highcharts.Chart(options);
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
		
		$.post($.webapp.root+"/admin/oa/project/get_project_shouzhu_count_report.do", function(result) {
			$(".report_text div#WSZ").css("color","#55BF3B").children("span:eq(1)").html(result[0][1]) ;
			$(".report_text div#YSZ").css("color","#058DC7").children("span:eq(1)").html(result[1][1]) ;
			options.series[0].data = result ;
			options.title.text = '受注状态统计' ;
			options.chart.renderTo = "container3" ;
			chart = new Highcharts.Chart(options);
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
		
		$.post($.webapp.root+"/admin/oa/project/get_project_cwjszt_count_report.do", function(result) {
			$(".report_text div#WJS").css("color","#55BF3B").children("span:eq(1)").html(result[0][1]) ;
			$(".report_text div#YJS").css("color","#058DC7").children("span:eq(1)").html(result[1][1]) ;
			options.series[0].data = result ;
			options.title.text = '财务结算状态统计' ;
			options.chart.renderTo = "container5" ;
			chart = new Highcharts.Chart(options);
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
		
		$.post($.webapp.root+"/admin/oa/project/get_project_jxzt_count_report.do", function(result) {
			$(".report_text div#WJX").css("color","#55BF3B").children("span:eq(1)").html(result[0][1]) ;
			$(".report_text div#YJX").css("color","#058DC7").children("span:eq(1)").html(result[1][1]) ;
			options.series[0].data = result ;
			options.title.text = '项目结项状态统计' ;
			options.chart.renderTo = "container4" ;
			chart = new Highcharts.Chart(options);
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
		
		$.post($.webapp.root+"/admin/oa/project/getProjectByYearCount.do", function(result) {
			var ss = "" ;
			$.each(result, function(i,p){
				ss+= "<div><span>"+p[0]+"（个）：</span><span>"+p[1]+"</span></div>" ;
			});
			$("#_byyear").html(ss) ;
			
			options.series[0].data = result ;
			options.title.text = '项目结束年份统计' ;
			options.chart.renderTo = "container6" ;
			chart = new Highcharts.Chart(options);
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
		
		$.post($.webapp.root+"/admin/oa/project/getProjectByDeptEndTimeCount.do", function(result) {
			var ss = "" ;
			$.each(result, function(i,p){
				ss+= "<div><span>"+p[0]+"（个）：</span><span>"+p[1]+"</span></div>" ;
			});
			$("#_deptname").html(ss) ;
			
			options.series[0].data = result ;
			options.title.text =  $.date.format(new Date(), "yyyy")+'年结束项目分布' ;
			options.chart.renderTo = "container7" ;
			chart = new Highcharts.Chart(options);
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
		
		$.post($.webapp.root+"/admin/oa/project/getProjectByDeptProcessTimeCount.do", function(result) {
			var ss = "" ;
			$.each(result, function(i,p){
				ss+= "<div><span>"+p[0]+"（个）：</span><span>"+p[1]+"</span></div>" ;
			});
			$("#_deptname1").html(ss) ;
			
			options.series[0].data = result ;
			options.title.text =  '进行中项目分布' ;
			options.chart.renderTo = "container8" ;
			chart = new Highcharts.Chart(options);
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
		
		$.post($.webapp.root+"/admin/oa/project/getProjectWJXByYearCount.do", function(result) {
			var ss = "" ;
			$.each(result, function(i,p){
				ss+= "<div><span>"+p[0]+"（个）：</span><span>"+p[1]+"</span></div>" ;
			});
			$("#_wjx_byyear").html(ss) ;
			
			options.series[0].data = result ;
			options.title.text = '未结项统计' ;
			options.chart.renderTo = "container9" ;
			chart = new Highcharts.Chart(options);
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
		
		$.post($.webapp.root+"/admin/oa/project/getProjectWJSByYearCount.do", function(result) {
			var ss = "" ;
			$.each(result, function(i,p){
				ss+= "<div><span>"+p[0]+"（个）：</span><span>"+p[1]+"</span></div>" ;
			});
			$("#_wjs_byyear").html(ss) ;
			
			options.series[0].data = result ;
			options.title.text = '未结算统计' ;
			options.chart.renderTo = "container10" ;
			chart = new Highcharts.Chart(options);
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
		
		$.post($.webapp.root+"/admin/oa/project/getProjectWJXByDept.do", function(result) {
			var ss = "" ;
			$.each(result, function(i,p){
				ss+= "<div><span>"+p[0]+"（个）：</span><span>"+p[1]+"</span></div>" ;
			});
			$("#_wjx_bydept").html(ss) ;
			
			options.series[0].data = result ;
			options.title.text = '未结项部门分布统计' ;
			options.chart.renderTo = "container11" ;
			chart = new Highcharts.Chart(options);
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
		
		$.post($.webapp.root+"/admin/oa/project/getProjectWJSByDept.do", function(result) {
			var ss = "" ;
			$.each(result, function(i,p){
				ss+= "<div><span>"+p[0]+"（个）：</span><span>"+p[1]+"</span></div>" ;
			});
			$("#_wjs_bydept").html(ss) ;
			
			options.series[0].data = result ;
			options.title.text = '未结算部门分布统计' ;
			options.chart.renderTo = "container12" ;
			chart = new Highcharts.Chart(options);
		}, 'json').error(function() {alert(options.title.text+"，发生错误！");});
	});
    </script>
    <style>
    .draw_tab{
    	margin: 0 auto;
    	border-collapse:collapse;border-spacing:0;
    	display: table;
    }
    .draw_tab td{
    	width: 500px; 
    	height: 300px;
    }
    .draw_tab td .draw_view {
    	margin:5px;
    }
    .draw_tab td .draw_view td.td1{
    	border:1px solid #ddd;
    	height:400px;
    	
    }
    .draw_tab td .draw_view td.td2{
    	border:1px solid #ddd;
    	height:90px;
    	vertical-align: top;
    }
    </style>
</head>

<body>
	<table class="draw_tab">
		<tr>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container6" class="td1"></td><!-- 统计年份项目数（当前年会包含已结束项目和未结束项目）  -->
					</tr>
					<tr>
						<td class="td2"><div class="report_text" id="_byyear"></div></td>
					</tr>
				</table>
			</td>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container7" class="td1"></td><!-- 统计年份项目数（当前年会包含已结束项目和未结束项目）  -->
					</tr>
					<tr>
						<td class="td2"><div class="report_text" id="_deptname"></div></td>
					</tr>
				</table>
			</td>
		</tr>
		
		<tr>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container2" class="td1"></td>
					</tr>
					<tr>
						<td class="td2">
							<div class="report_text">
								<div id="status0"><span>立项中（个）：</span><span>0</span></div>
								<div id="status1"><span>审批中（个）：</span><span>0</span></div>
								<div id="status2"><span>进行中（个）：</span><span>0</span></div>
								<div id="status3"><span>挂起中（个）：</span><span>0</span></div>
								<div id="status4"><span>已结束（个）：</span><span>0</span></div>
							</div>
						</td>
					</tr>
				</table>
			</td>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container8" class="td1"></td><!-- 统计年份项目数（当前年会包含已结束项目和未结束项目）  -->
					</tr>
					<tr>
						<td class="td2"><div class="report_text" id="_deptname1"></div></td>
					</tr>
				</table>
			</td>
		</tr>
		
		<tr>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container1" class="td1"></td>
					</tr>
					<tr>
						<td class="td2">
							<div class="report_text">
								<div id="TA"><span>提案（个）：</span><span>0</span></div>
								<div id="HTXM"><span>合同项目（个）：</span><span>0</span></div>
								<div id="ZZYF"><span>自主研发（个）：</span><span>0</span></div>
								<div id="GSSY"><span>公司使用（个）：</span><span>0</span></div>
								<div id="GSTZ"><span>公司投资（个）：</span><span>0</span></div>
							</div>
						</td>
					</tr>
				</table>
			</td>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container3" class="td1"></td>
					</tr>
					<tr>
						<td class="td2">
							<div class="report_text">
								<div id="YSZ"><span>已受注（个）：</span><span>0</span></div>
								<div id="WSZ"><span>未受注（个）：</span><span>0</span></div>
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		
		<tr>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container4" class="td1"></td>
					</tr>
					<tr>
						<td class="td2">
							<div class="report_text">
								<div id="YJX" class="center"><span>已结项（个）：</span><span>0</span></div>
								<div id="WJX" class="center"><span>未结项（个）：</span><span>0</span></div>
							</div>
						</td>
					</tr>
				</table>
			</td>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container5" class="td1"></td>
					</tr>
					<tr>
						<td class="td2">
							<div class="report_text">
								<div id="YJS" class="center"><span>已结算（个）：</span><span>0</span></div>
								<div id="WJS" class="center"><span>未结算（个）：</span><span>0</span></div>
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		
		<tr>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container9" class="td1"></td><!-- 项目未结项分布  -->
					</tr>
					<tr>
						<td class="td2"><div class="report_text" id="_wjx_byyear"></div></td>
					</tr>
				</table>
			</td>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container10" class="td1"></td><!-- 项目未结算分布  -->
					</tr>
					<tr>
						<td class="td2"><div class="report_text" id="_wjs_byyear"></div></td>
					</tr>
				</table>
			</td>
		</tr>
		
		<tr>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container11" class="td1"></td><!-- 项目未结项分布  -->
					</tr>
					<tr>
						<td class="td2"><div class="report_text" id="_wjx_bydept"></div></td>
					</tr>
				</table>
			</td>
			<td>
				<table class="draw_view">
					<tr>
						<td id="container12" class="td1"></td><!-- 项目未结算分布  -->
					</tr>
					<tr>
						<td class="td2"><div class="report_text" id="_wjs_bydept"></div></td>
					</tr>
				</table>
			</td>
		</tr>
		
	</table>
	
</body>
</html>



